/*
 * @Author: 刘润泽
 * @Date: 2023-02-22 19:39:56
 * @LastEditors: 刘润泽
 * @LastEditTime: 2023-03-06 17:38:42
 * @Description: 
 */
package server.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import server.business.pojo.BloodComposition;
import server.business.service.BloodCompositionService;
import server.business.utils.Result;

import java.util.List;

@Controller
@RequestMapping("/bloodComposition")
public class BloodCompositionController {
    @Autowired
    private BloodCompositionService bloodCompositionService;

    /**
     * 查询血液成分
     */
    @RequestMapping("/normal/queryBloodComposition")
    @ResponseBody
    public Result queryBloodComposition() {
        bloodCompositionService.list();
        Result result = new Result();
        result.setData(bloodCompositionService.list());
        return result;
    }

    @RequestMapping("/normal/query")
    @ResponseBody
    public List<BloodComposition> queryData() {
        List<BloodComposition> list = bloodCompositionService.queryData();
        return list;
    }

    @GetMapping(value = "/normal/getName")
    @ResponseBody
    public server.business.utils.results.lrz.Result getName() {
        List<BloodComposition> bloodCompositionList = bloodCompositionService.list();
        return server.business.utils.results.lrz.Result.success(bloodCompositionList);
    }
}
